package com.solidumgame.martillo.tablewood
{
	import com.pblabs.engine.PBE;
	import com.pblabs.engine.entity.PropertyReference;
	import com.pblabs.rendering2D.SpriteRenderer;
	
	import flash.geom.Point;
	
	public class TableWoodRendererComponent extends SpriteRenderer
	{
		
		private var bodyPosition:Point;
		
		public function TableWoodRendererComponent()
		{
			super();
			
			this.fileName = "../assets/downTable.png";
			
			this.scene = PBE.scene;
			this.layerIndex = 30;

			this.position = new Point(-10000,210);
			this.size = new Point(413,51);
			//this.rotationProperty = new PropertyReference("@Spatial.rotation");
		}
		
		override public function onFrame(onFrame:Number):void
		{	
			super.onFrame(onFrame);
			bodyPosition = Point(owner.getProperty(new PropertyReference("@Spatial.position")));
			this.position = new Point(bodyPosition.x+36,bodyPosition.y+26-15);
		}
	}
}